<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>


<!doctype html>
<html>
	<head>
		<title>学生管理系统</title>
		<meta charset="gbk">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<link href="login/bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet" media="screen">
		<script src="login/angular.min.js"></script>
		<style type="text/css">
        * {
            box-sizing: border-box;
			font-family:"微软雅黑";
        }
        body {
            margin: 0; 
            padding: 0;
            font: 16px/20px microsft yahei;
        }
        .wrap {
                width: 100vw;
				height: 100vh;
				opacity: 0.8;
				background: linear-gradient(to bottom right,#50a3a2,#53e3a6);
				background: -webkit-linear-gradient(to bottom right,#50a3a2,#53e3a6);
				position:fixed;
        }
        .container {
            width: 500px;
            margin: 0 auto;
			position:relative;
			top:30%;
        }
        .container h1 {
            text-align: center;
            color: #FFFFFF;
            font-weight: 500;
        }
        .wrap ul {
            position: absolute;
            top: 0;
            left: 0;
            width: 100vw;
			height: 100vh;
            z-index: -10;
        }
        .wrap ul li {
            list-style-type: none;
            display: block;
            position: absolute;
            bottom: -120px;
            width: 15px;
            height: 15px;
            z-index: -8;
            background-color:rgba(255, 255, 255, 0.15);
            animotion: square 25s infinite;
            -webkit-animation: square 25s infinite;
        }
        .wrap ul li:nth-child(1) {
            left: 0;
            animation-duration: 10s;
            -moz-animation-duration: 10s;
            -o-animation-duration: 10s;
            -webkit-animation-duration: 10s;
        }
        .wrap ul li:nth-child(2) {
            width: 40px;
            height: 40px;
            left: 10%;
            animation-duration: 15s;
            -moz-animation-duration: 15s;
            -o-animation-duration: 15s;
            -webkit-animation-duration: 15s;
        }
        .wrap ul li:nth-child(3) {
            left: 20%;
            width: 25px;
            height: 25px;
            animation-duration: 12s;
            -moz-animation-duration: 12s;
            -o-animation-duration: 12s;
            -webkit-animation-duration: 12s;
        }
        .wrap ul li:nth-child(4) {
            width: 50px;
            height: 50px;
            left: 30%;
            -webkit-animation-delay: 3s;
            -moz-animation-delay: 3s;
            -o-animation-delay: 3s;
            animation-delay: 3s;
            animation-duration: 12s;
            -moz-animation-duration: 12s;
            -o-animation-duration: 12s;
            -webkit-animation-duration: 12s;
        }
        .wrap ul li:nth-child(5) {
            width: 60px;
            height: 60px;
            left: 40%;
            animation-duration: 10s;
            -moz-animation-duration: 10s;
            -o-animation-duration: 10s;
            -webkit-animation-duration: 10s;
        }
        .wrap ul li:nth-child(6) {
            width: 75px;
            height: 75px;
            left: 50%;
            -webkit-animation-delay: 7s;
            -moz-animation-delay: 7s;
            -o-animation-delay: 7s;
            animation-delay: 7s;
        }
        .wrap ul li:nth-child(7) {
            left: 60%;
            animation-duration: 8s;
            -moz-animation-duration: 8s;
            -o-animation-duration: 8s;
            -webkit-animation-duration: 8s;
        }
        .wrap ul li:nth-child(8) {
            width: 90px;
            height: 90px;
            left: 70%;
            -webkit-animation-delay: 4s;
            -moz-animation-delay: 4s;
            -o-animation-delay: 4s;
            animation-delay: 4s;
        }
        .wrap ul li:nth-child(9) {
            width: 100px;
            height: 100px;
            left: 80%;
            animation-duration: 20s;
            -moz-animation-duration: 20s;
            -o-animation-duration: 20s;
            -webkit-animation-duration: 20s;
        }
        .wrap ul li:nth-child(10) {
            width: 120px;
            height: 120px;
            left: 90%;
            -webkit-animation-delay: 6s;
            -moz-animation-delay: 6s;
            -o-animation-delay: 6s;
            animation-delay: 6s;
            animation-duration: 30s;
            -moz-animation-duration: 30s;
            -o-animation-duration: 30s;
            -webkit-animation-duration: 30s;
        }

        @keyframes square {
            0%  {
                    -webkit-transform: translateY(0);
                    transform: translateY(0)
                }
            100% {
                    bottom: 400px;
                    transform: rotate(600deg);
                    -webit-transform: rotate(600deg);
                    -webkit-transform: translateY(-500);
                    transform: translateY(-500)
            }
        }
        @-webkit-keyframes square {
            0%  {
                -webkit-transform: translateY(0);
                transform: translateY(0)
            }
            100% {
                bottom: 400px;
                transform: rotate(600deg);
                -webit-transform: rotate(600deg);
                -webkit-transform: translateY(-500);
                transform: translateY(-500)
            }
        }
		/*重写bootstrap样式*/
		.form-group{
			margin:30px 0;
		}
		.form-control{
			height:45px;
		}
		.control-label{
			text-center;
		}
		.form-horizontal{
			margin-top:20px;margin-right: 0px;padding-right: 0px;position: relative;left: -8%;
		}
    </style>
	</head>
	<body ng-app="myApp" ng-controller="validateCtrl">
		<div class="wrap">
			<div class="container">
				<h1>欢迎，我的朋友</h1>
				<form class="form-horizontal row" style="margin-top:20px;" method="post" action="LoginServlet">
				  <div class="form-group">
					<label for="name" class="col-sm-2 control-label">名称</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" id="name" name="loginname"placeholder="请输入名称">
					</div>
				  </div>
				  <div class="form-group">
					<label for="Password" class="col-sm-2 control-label">密码</label>
					<div class="col-sm-10">
					  <input type="password" class="form-control" id="password" name="loginpassword" placeholder="请输入密码">
					</div>
				  </div>
				  <div class="form-group">
					<div class="col-sm-2"></div>
					<div class="col-sm-4">
					  <button type="" class="btn btn-default center-block" id="sign_in"><a href="#" data-toggle="modal" data-target="#about-modal">注册</a></button>
					</div>
					<div class="col-sm-4">
					  <button type="submit" class="btn btn-default center-block" id="login">登录</button>
					</div>
					<div class="col-sm-2"></div>
				  </div>
				</form>
			</div>
			<ul>
				<li></li>
				<li></li>
				<li></li>
				<li></li>
				<li></li>
				<li></li>
				<li></li>
				<li></li>
				<li></li>
				<li></li>
			</ul>
		</div>
		<div class="modal fade" id="about-modal" tabindex="-1" role="dialog" aria-labelledby="modal-label"
			 aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"><span
								aria-hidden="true">&times;</span><span class="sr-only">关闭</span></button>
						<h4 class="modal-title" id="modal-label">注册页面</h4>
					</div>
					<div class="modal-body">
						<div class="container-fluid">
							<div class="row">
							<form class="form-horizontal" action="RegisterServlet" method="post" name="user">
								<div class="form-group">
									<label for="inputName" class="col-sm-4 col-xs-6 control-label">请输入姓名</label>
									<div class="col-sm-8 col-xs-6">
										<input type="name" ng-model="name" class="form-control" id="inputName" name="name" placeholder="姓名" required/>
										<span ng-show="user.name.$dirty && user.name.$invalid" style="color:red">
											<span ng-show="user.name.$error.required">内容不能为空</span>
											<span ng-show="user.name.$error.name">名字格式不符合</span>
										</span>
									</div>
								</div>
								<div class="form-group">
									<label for="inputNumber" class="col-sm-4 control-label">请输入学号</label>
									<div class="col-sm-8">
										<input type="number" ng-model="number" class="form-control" id="inputNumber" name="number" placeholder="学号" ng-maxlength="15" ng-minlength="5" required/>
										<span ng-show="user.number.$dirty && user.number.$invalid" style="color:red">
											<span ng-show="user.number.$error.required">内容不能为空</span>
											<span ng-show="user.number.$error.minlength">长度不能小于最小值</span>
											<span ng-show="user.number.$error.maxlength">长度不能大于最大值</span>
											<span ng-show="user.number.$error.number">学号格式错误</span>
										<span>
									</div>
								</div>
								<div class="form-group">
									<label for="inputEmail" class="col-sm-4 control-label">请输入邮箱</label>
									<div class="col-sm-8">
										<input type="email" ng-model="email" class="form-control" id="inputEmail" name="email" placeholder="邮箱" required/>
										<span ng-show="user.email.$dirty && user.email.$invalid" style="color:red">
											<span ng-show="user.email.$error.required">内容不能为空</span>
											<span ng-show="user.email.$error.email">非法的邮箱地址。</span>
										</span>
									</div>
									</div>
									<div class="form-group">
										<label for="password" class="col-sm-4 control-label">请输入密码</label>
										<div class="col-sm-8">
											<input type="password" ng-model="password" name="password" class="form-control" id="inputPassword1" placeholder="密码" ng-maxlength="15" ng-minlength="5" required>
											<span style="color: red" ng-show="user.password.$invalid">
												<span ng-show="user.password.$error.minlength">密码长度不小于6</span>
												<span ng-show="user.password.$error.maxlength">密码长度不超过20</span>
											</span>
										</div>
									</div>
									<div class="form-group">
										<label for="inputPassword2" class="col-sm-4 control-label">请再输入密码</label>
										<div class="col-sm-8">
											<input type="password" ng-model="passwordagain" name="passwordagain" class="form-control" id="inputPassword2" 
												placeholder="再输入密码" ng-maxlength="15" ng-minlength="5" required>
											<span style="color: red" ng-show="user.password.$valid">
												<span ng-show="passwordagain!=password">两次密码输入不一致</span>
											</span>
										</div>
									</div>				  
									<div class="form-group">
										<div class="col-sm-offset-4 col-sm-6">
											<select class="form-control">
												<option value="Student">学生</option>
												<option value="Teacher">教师</option>
											</select>
										</div>										
									</div>			
								</form>
							</div>
						</div>
					</div>
					<div class="modal-footer">
						<button class="btn btn-default" data-dismiss="modal" type="submit" class="btn btn-default"  
							ng-disabled="user.name.$pristine && user.name.$invalid ||
							user.email.$pristine && user.email.$invalid || user.password.$pristine && user.password.$invalid 
							|| passwordagain!=password ||user.password.$pristine && user.password.$invalid ||
							user.passwordagain.$pristine && user.passwordagain.$invalid"
							>注册成功</button>
					</div>
				</div>
			</div>
		</div>
		<script src="login/jquery-3.2.0.min.js"></script>
		<script src="login/bootstrap-3.3.7-dist\js\bootstrap.min.js"></script>
		<script>
			var myApp =  angular.module("myApp",[]);
				myApp.controller("validateCtrl",function($scope){		
			});
		</script>
	</body>
</html>
